<template>
  <div class="bg">
    <nav-com
      title="一起向未来"
      :showView="true"
      @back="backHandler()"
    ></nav-com>
    <div class="bg">
      <div class="num" @click="confirm">
      <div class="item-list" style="border-bottom: 1px solid rgba(195, 37, 38, 0.12);">
        <div class="item" :style="num1==1000?'background: rgba(215, 215, 215, 0.4);color:#FFF':''">
          <div class="item1">1000单<div v-if="num1==1000" style="color:rgba(135, 33, 24, 1)!important">(已满)</div></div>
          <div class="item2">(赠8000等值股票)</div>
          <div class="item3">{{num1}}</div>
          <div class="item4">计数</div>
        </div>
        <div class="split"></div>
        <!-- <div class="item">
          <div class="item1">1000单</div>
          <div class="item2">(赠1000等值股票)</div>
          <div class="item3">656</div>
          <div class="item4">计数</div>
        </div>
        <div class="split"></div> -->
        <div class="item" :style="num2==1000?'background: rgba(215, 215, 215, 0.4);color:#FFF':''">
          <div class="item1">1000单<div v-if="num2==1000" style="color:rgba(135, 33, 24, 1)!important">(已满)</div></div>
          <div class="item2">(赠7000等值股票)</div>
          <div class="item3">{{num2}}</div>
          <div class="item4">计数</div>
        </div>
      </div>
      <div class="item-list" >
        <div class="item" :style="num3==1000?'background: rgba(215, 215, 215, 0.4);color:#FFF':''">
          <div class="item1">1000单<div v-if="num3==1000" style="color:rgba(135, 33, 24, 1)!important">(已满)</div></div>
          <div class="item2">(赠6000等值股票)</div>
          <div class="item3">{{num3}}</div>
          <div class="item4">计数</div>
        </div>
        <div class="split"></div>
        <div class="item" :style="num4==1000?'background: rgba(215, 215, 215, 0.4);color:#FFF':''">
          <div class="item1">1000单<div v-if="num4==1000" style="color:rgba(135, 33, 24, 1)!important">(已满)</div></div>
          <div class="item2">(赠5000等值股票)</div>
          <div class="item3">{{num4}}</div>
          <div class="item4">计数</div>
        </div>
        <div class="split"></div>
        <div class="item" :style="num5==1000?'background: rgba(215, 215, 215, 0.4);color:#FFF':''">
          <div class="item1">1000单<div v-if="num5==1000" style="color:rgba(135, 33, 24, 1)!important">(已满)</div></div>
          <div class="item2">(赠4000等值股票)</div>
          <div class="item3">{{num5}}</div>
          <div class="item4">计数</div>
        </div>
      </div>
    </div>
    <div class="buttonLuck" @click="confirmLuck">查看幸运的人</div>
    <div class="button" @click="confirm">确定</div>
    </div>
    <van-popup v-model="show">
      <div class="popup">
          <div style="color: rgba(135, 33, 24, 1);line-height: 40px;font-weight: 600;">幸运人员</div>
          <div style="width: 85vw;font-size: 10px;color: rgba(135, 33, 24, 1); margin: 10px;">
            <div style="display:flex;align-items: center; justify-content: space-between; line-height: 35px;border-bottom: .5px solid rgba(249, 236, 231, 1);" v-for="item in list">
              <div style="min-width: 20vw;">第{{item.ranking}}单的人</div>
              <div style="min-width: 10vw;">{{item.channelSource}} </div>
              <div style="min-width: 20vw;">{{item.phone}}</div>
              <div style="min-width: 20vw;">{{item.payTime}}</div>
            </div>
          </div>
      </div>
    </van-popup>
  </div>
  
</template>

<script>
import navCom from "@/component/nav";
import { getOrderNum,managerAnalysis } from "@/api/api";

import { Popup, uLine } from "vant";
export default {
  components: {
    navCom,
  },
  data() {
    return {
      num1: 0,
      num2: 0,
      num3: 0,
      num4: 0,
      num5: 0,
      show:false,
      list:[]
    };
  },
  mounted() {
    this.initData();
  },
  methods: {
    confirm() {
      this.$router.push("/everyMonth3");
    },
    confirmLuck() {
      console.log("confirmLuck");
      this.show=true
    },
    initData() {
      managerAnalysis()
        .then((result) => {
          console.log(result.data.data);
          this.num1 = result.data.data.list[1];
          this.num2 = result.data.data.list[2];
          this.num3 = result.data.data.list[3];
          this.num4 = result.data.data.list[4];
          this.num5 = result.data.data.list[5];
          this.list = result.data.data.data;
        })
        .catch((err) => {});
    },
    backHandler() {
      this.$router.go(-1);
      // if (weixin.isAndroid()) {
      //   window.JS_TROOPS.goBack();
      // } else {
      //   this.$router.go(-1);
      // }
    },
  },
};
</script>

<style scoped>
body{
  overflow: hidden;
}
.buttonLuck{
  color: rgba(135, 33, 24, 1);
  line-height: 10vw;
  text-align: center;
  border-radius: 5vw;
  width: 160px;
  line-height: 44px;
  background: rgba(195, 37, 38, 0.12);
  border-radius: 20px;
  margin: 0 auto;
  margin-top: 15vh;
}
.button {
  color: #fff;
  line-height: 10vw;
  text-align: center;
  border-radius: 5vw;
  width: 160px;
  line-height: 44px;
  background: #FE4B20;
  border-radius: 20px;
  margin: 0 auto;
  margin-top: 2vh;
}
.bg {
  position: relative;
  height: 100vh;
  background: url("../../assets/my/sharesBG.jpg");
  background-size: 100% 100%;
  overflow: hidden;
}
.num {
  width: 90vw;
  background: rgba(195, 37, 38, 0.12);
  /* opacity: 0.12; */
  border-radius: 12px;
  margin: 0 auto;
  margin-top: 28vh;
  border-radius: 3vw;
  display: flex;
  color: #872118;
  flex-direction: column;
  /* padding: 10px; */

}
.item-list{
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

.item{
  display: flex;
  flex-direction: column;
  /* color: #fff; */
  color: #872118;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  flex: 1;
}
.item1{
  line-height: 20px;
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 500;
  display: flex;
}
.item2{
  line-height: 15px;
  font-size: 10px;
  font-family: PingFang SC;
  font-weight: 500;
  /* color: #872118; */
}
.item3{
  /* width: 79px; */
  line-height: 36px;
  font-size: 23px;
  font-family: Source Han Sans CN;
  font-weight: bold;
  /* color: #872118; */
}
.item4{
  font-size: 12px;
  font-family: PingFang SC;
  font-weight: 500;
  /* color: #872118; */
  line-height: 15px;
}
.split{
  width: .5px;
  height: 60px;
  background: #872118;
  opacity: 0.15;
}
.van-popup {
  background-color: transparent !important;
}
.popup {
  width: 90vw;
  min-height: 250px;
  background-image: url(../../assets/xyrybg.png);
  background-repeat: round;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.popup .item1 {
  /* width: 336px; */
  height: 24px;
  font-size: 12px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  font-style: italic;
  color: #95613d;
  line-height: 42px;
}
.popup .item2 {
  height: 42px;
  font-size: 21px;
  font-family: Source Han Sans CN;
  font-weight: 800;
  color: #8d562f;
  line-height: 50px;
  text-shadow: 0px 5px 3px rgba(193, 133, 68, 0.29);
}
.popup .item3 {
  height: 21px;
  font-size: 10px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #97480f;
  line-height: 35px;
  display: flex;
  align-items: center;
}
.popup .item3 img {
  margin-left: 5px;
}
.popup .item4 {
  font-size: 15px;
  font-family: Source Han Sans CN;
  font-weight: 500;
  color: #ffffff;
  /* line-height: 44px; */
  margin-top: 35px;
  background: linear-gradient(
    0deg,
    rgba(249, 236, 135, 0.76) 0%,
    rgba(238, 174, 91, 0.76) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.popup .item5 {
  height: 19px;
  font-size: 5px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #ffffff;
  line-height: 24px;
  opacity: 0.27;
  transform: scale(0.8);
}
</style>